export const model = {
  id: "",
  roleName: "",
  roleCode: "",
  roleDesc: "",
  roleStatus: 0,
  ids: [],
  idsA: [],
};

export const rules = {
  roleName: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
  roleCode: [{ required: true, message: "请输入角色编码", trigger: "blur" }],
  roleDesc: [{ required: true, message: "请输入角色描述", trigger: "blur" }],
};

export const columns = [
  {
    title: "序号",
    dataIndex: "id",
    width: 40,
    align: "center",
    customRender: (text, record, index) => {
      return index + 1;
    },
  },
  {
    title: "角色名称",
    dataIndex: "roleName",
    key: "roleName",
    width: 120,
    align: "center",
  },
  {
    title: "角色编码",
    dataIndex: "roleCode",
    key: "roleCode",
    width: 80,
    align: "center",
  },
  {
    title: "角色描述",
    dataIndex: "roleDesc",
    key: "roleDesc",
    width: 80,
    align: "center",
  },
  {
    title: "角色状态",
    dataIndex: "roleStatus",
    key: "roleStatus",
    width: 80,
    align: "center",
    // eslint-disable-next-line no-unused-vars
    // customRender: (t, r, i) => {
    //   if (t === 0) {
    //     return "正常";
    //   } else {
    //     return "禁用";
    //   }
    // },
    scopedSlots: { customRender: "roleStatus" },
  },
  {
    title: "创建人",
    dataIndex: "createBy",
    key: "createBy",
    width: 100,
    align: "center",
  },
  {
    title: "创建时间",
    dataIndex: "createTime",
    key: "createTime",
    width: 120,
    align: "center",
  },
  {
    title: "操作",
    key: "action",
    width: 150,
    fixed: "right",
    align: "center",
    scopedSlots: { customRender: "action" },
  },
];
